/** Project : Sticky Notes Plus */
/** Author  : Sainagakishore Srikantham */
/** Email   : ssn.kishore@gmail.com */

/** File    : StickyNote.h */
/** Purpose : This file contains the definition for the class CStickyNote which is basic type of note the user
              can create. This class also is the base for other types of notes. */

#ifndef STICKYNOTE_H
#define STICKYNOTE_H

#include <QWidget>
#include "StickyNotesEnums.h"

QT_BEGIN_NAMESPACE
class QTextEdit;
class QVBoxLayout;
class QLabel;
class QTextDocument;
QT_END_NAMESPACE

class CStickyNote : public QWidget
{
    Q_OBJECT
public:
    /** Constructor of the class */
    CStickyNote(int aNoteId, bool aBeingReloaded);

    /** Destructor of the class */
    ~CStickyNote();

    /** Returns the title of the note */
    QString GetTitle();

    /** Sets the note title */
    void SetTitle(QString aTitle);

    /** Returns the message of the note */
    QString GetMsg();

    /** Sets the note message */
    void SetMsg(QString aMsg);

    /** Returns the type of the note */
    NoteType GetNoteType();

    /** Sets the note type */
    void SetNoteType(NoteType aNoteType);

    /** Returns the note id */
    int GetNoteId();

private slots:
    /** Function called on the "text modified" signal to check that the user doesn't surpass 140 characters */
    void CheckNoteWidth();

private:
    /** Data Components */
    QString iTitle;
    QString iMsg;
    NoteType iNoteType;
    int iNoteId;

    /** UI Components */
    QTextEdit* iTextEdit;
    QLabel* iCharsRem;
    QVBoxLayout* iMainLayout;

    static const int iNoteLength;
};

#endif // STICKYNOTE_H
